package com.anycc.cloud.core.repository;

import com.anycc.cloud.core.entity.Area;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 区域查询工厂类
 */
public interface AreaRepository extends JpaRepository<Area, String>, JpaSpecificationExecutor<Area> {

    /**
     * find area by name or code
     * @param name name
     * @param code code
     * @return List<Area>
     */
    List<Area> findByNameOrCode(String name, String code);

    Area findByCode(String code);
}
